package com.sunwayhorizo.health.ets.base.persistent;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.TableGenerator;

@Entity
@TableGenerator(name = "Concept_IdGenerator", table = "ET_Id_Generator", pkColumnName = "pkColumn", valueColumnName = "valueColumn", pkColumnValue = "Concept_Id")
@NamedQuery(name = "EtConcepts.findAll", query = "select o from EtConcepts o")
//@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Table(name = "ET_CONCEPTS")
public class EtConcepts implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "Concept_IdGenerator")
	@Column(name = "CONCEPT_ID", nullable = false)
	private String conceptId;
	
	@Column(name = "CONCEPT_CODE", nullable = false)
	private String conceptCode;
	
	@Column(name = "CONCEPT_NAME", nullable = false)
	private String conceptName;
	
	@Column(name = "RETIRED_DATE")
	private Timestamp retiredDate;
	
	@Column(name = "STATUS_CODE", nullable = false)
	private String statusCode;
	
	@Column(name = "RELATIONSHIP_TYPE_FLAG", nullable = false)
	private String relationshipTypeFlag;
	
	@Column(name = "EXTENDED_TYPE_CODE")
	private String extendedTypeCode;
	
	@Column(name = "CLIQUE_ID")
	private String cliqueId;
	
	@Column(name = "CLASSIFICATION_STATUS_CODE")
	private String classificationStatusCode;
	
	@Column(name = "DOMAIN_TXT")
	private String domainTxt;
	
	@Column(name = "BUILD_NUM")
	private Long buildNum;

	@Column(name = "CREATION_DATE", nullable = false)
	private Timestamp creationDate;
	
	@Column(name = "CREATED_BY", nullable = false)
	private Long createdBy;
	
	@Column(name = "CREATED_BY_NAME", nullable = false)
	private String createdByName;
	
	@Column(name = "LAST_UPDATE_DATE", nullable = false)
	private Timestamp lastUpdateDate;
	
	@Column(name = "LAST_UPDATED_BY", nullable = false)
	private Long lastUpdatedBy;
	
	@Column(name = "LAST_UPDATED_BY_NAME", nullable = false)
	private String lastUpdatedByName;
	
	@Column(name = "LAST_UPDATE_LOGIN")
	private Long lastUpdateLogin;
	
	//五笔
	@Column(name = "INPUT_PY")
	private String inputPy;
	
	@Column(name = "INPUT_WB")
	private String inputWb;
	
	@Column(name = "INPUT_CD")
	private String inputCd;
	
	@Column(name = "INPUT_EXT1")
	private String inputExt1;
	
	@Column(name = "INPUT_EXT2")
	private String inputExt2;
	
	//术语归类,例如：费别归类（自费、医保）；（厂商、供应商）；（超声,CT,MRI,放射,病理,心电图）
	@Column(name = "CONCEPT_CLASS")
	private String conceptClass;
	
	//医嘱执行频率（performFreq）-频率次数
	@Column(name = "FREQ_COUNTER")
	private String freqCounter;
	
	//医嘱执行频率（performFreq）-频率间隔
	@Column(name = "FREQ_INTERVAL")
	private String freqInterval;
	
	//医嘱执行频率（performFreq）-频率单位
	@Column(name = "FREQ_INTERVAL_UNIT")
	private String freqIntervalUnit;
	
	//给药途径和方法
	@Column(name = "ADMINISTRATIONS")
	private String administrations;
	
	//缺省执行时间
	@Column(name = "DEFAULT_SCHEDULE")
	private String defaultSchedule;
	
	@Basic(fetch=FetchType.LAZY)   
	@Lob @Column(name="CONCEPT_BLOB")   
	private byte[] etBlob;    
	
	@Lob
	@Basic(fetch = FetchType.EAGER)
	@Column(name = "CONCEPT_CLOB")
	private String etClob;
	
	@Column(name = "WRITE_TYPE_DICT_CODE")
    private String writeTypeDictCode;
	
	@Column(name = "MQA_MODEL_CODE")
    private String mqaModelCode;
	
	@Column(name = "INTACT_VALUE")
    private String intactValue;
	
	@Column(name = "IS_COEXIST")
    private String isCoexist;
	
	@Column(name = "RATE_HOUR")
    private String rateHour;
	
	@Column(name = "PATIENT_CONDITION_CODE")
    private String patientConditionCode;
	
	@Column(name = "IS_EQUIPPED")
    private String isEquipped;
	
	@Column(name = "ATTENTION_ROLE_CODE")
    private String attentionRoleCode;
	
	@Column(name = "ATTENTION_MESSAGES")
    private String attentionMessages;
	
	@Column(name = "MR_DOCUMENT_CLASS_CODE")
    private String mrDocumentClassCode;
	
	@Column(name = "GRADE_SCALE_STD_CODE")
    private String gradeScaleStdCode;
	
	@Column(name = "IS_ADD_UP")
    private String isAddUp;
	
	@Column(name = "IS_AUTO_COUNT")
	private String isAutoCount;
	
	@OneToMany(mappedBy = "etConcepts")
	private List<EtConcepts> etConceptsList = new ArrayList<EtConcepts>();
	
	@OneToMany(mappedBy = "etConcepts")
	private List<EtCncptlistAssgns> etCncptlistAssgnsList = new ArrayList<EtCncptlistAssgns>() ;
	
	@OneToMany(mappedBy = "etConcepts")
	private List<EtDescriptions> etDescriptionsList = new ArrayList<EtDescriptions>();

	@ManyToOne
	@JoinColumn(name = "REASSIGNED_TO_ID")
	private EtConcepts etConcepts;

	@ManyToOne
	@JoinColumn(name = "VERSION_ID")
	private EtVersions etVersions;

	public EtConcepts() {
		Long i = new Long(1);
		Timestamp nowTime = new Timestamp(new Date().getTime());

		createdBy = i;
		creationDate = nowTime;
		lastUpdatedBy = i;
		lastUpdateDate = nowTime;
		lastUpdateLogin = i;
	}

	public Long getBuildNum() {
		return buildNum;
	}

	public void setBuildNum(Long buildNum) {
		this.buildNum = buildNum;
	}

	public String getClassificationStatusCode() {
		return classificationStatusCode;
	}

	public void setClassificationStatusCode(String classificationStatusCode) {
		this.classificationStatusCode = classificationStatusCode;
	}

	public String getCliqueId() {
		return cliqueId;
	}

	public void setCliqueId(String cliqueId) {
		this.cliqueId = cliqueId;
	}

	public String getConceptCode() {
		return conceptCode;
	}

	public void setConceptCode(String conceptCode) {
		this.conceptCode = conceptCode;
	}

	public void setConceptName(String conceptName) {
		this.conceptName = conceptName;
	}

	public String getConceptName() {
		return conceptName;
	}

	public String getConceptId() {
		return conceptId;
	}

	public void setConceptId(String conceptId) {
		this.conceptId = conceptId;
	}

	public Long getCreatedBy() {
		return createdBy;
	}

	public void setCreatedBy(Long createdBy) {
		this.createdBy = createdBy;
	}

	public Timestamp getCreationDate() {
		return creationDate;
	}

	public void setCreationDate(Timestamp creationDate) {
		this.creationDate = creationDate;
	}

	public String getDomainTxt() {
		return domainTxt;
	}

	public void setDomainTxt(String domainTxt) {
		this.domainTxt = domainTxt;
	}

	public String getExtendedTypeCode() {
		return extendedTypeCode;
	}

	public void setExtendedTypeCode(String extendedTypeCode) {
		this.extendedTypeCode = extendedTypeCode;
	}

	public Long getLastUpdatedBy() {
		return lastUpdatedBy;
	}

	public void setLastUpdatedBy(Long lastUpdatedBy) {
		this.lastUpdatedBy = lastUpdatedBy;
	}

	public Timestamp getLastUpdateDate() {
		return lastUpdateDate;
	}

	public void setLastUpdateDate(Timestamp lastUpdateDate) {
		this.lastUpdateDate = lastUpdateDate;
	}

	public Long getLastUpdateLogin() {
		return lastUpdateLogin;
	}

	public void setLastUpdateLogin(Long lastUpdateLogin) {
		this.lastUpdateLogin = lastUpdateLogin;
	}

	public String getRelationshipTypeFlag() {
		return relationshipTypeFlag;
	}

	public void setRelationshipTypeFlag(String relationshipTypeFlag) {
		this.relationshipTypeFlag = relationshipTypeFlag;
	}

	public Timestamp getRetiredDate() {
		return retiredDate;
	}

	public void setRetiredDate(Timestamp retiredDate) {
		this.retiredDate = retiredDate;
	}

	public String getStatusCode() {
		return statusCode;
	}

	public void setStatusCode(String statusCode) {
		this.statusCode = statusCode;
	}

	public EtConcepts getEtConcepts() {
		return etConcepts;
	}

	public void setEtConcepts(EtConcepts etConcepts) {
		this.etConcepts = etConcepts;
	}

	public List<EtConcepts> getEtConceptsList() {
		return etConceptsList;
	}

	public void setEtConceptsList(List<EtConcepts> etConceptsList) {
		this.etConceptsList = etConceptsList;
	}

	public EtConcepts addEtConcepts(EtConcepts etConcepts) {
		getEtConceptsList().add(etConcepts);
		etConcepts.setEtConcepts(this);
		return etConcepts;
	}

	public EtConcepts removeEtConcepts(EtConcepts etConcepts) {
		getEtConceptsList().remove(etConcepts);
		etConcepts.setEtConcepts(null);
		return etConcepts;
	}

	public List<EtCncptlistAssgns> getEtCncptlistAssgnsList() {
		return etCncptlistAssgnsList;
	}

	public void setEtCncptlistAssgnsList(
			List<EtCncptlistAssgns> etCncptlistAssgnsList) {
		this.etCncptlistAssgnsList = etCncptlistAssgnsList;
	}

	public EtCncptlistAssgns addEtCncptlistAssgns(
			EtCncptlistAssgns etCncptlistAssgns) {
		getEtCncptlistAssgnsList().add(etCncptlistAssgns);
		etCncptlistAssgns.setEtConcepts(this);
		return etCncptlistAssgns;
	}

	public EtCncptlistAssgns removeEtCncptlistAssgns(
			EtCncptlistAssgns etCncptlistAssgns) {
		getEtCncptlistAssgnsList().remove(etCncptlistAssgns);
		etCncptlistAssgns.setEtConcepts(null);
		return etCncptlistAssgns;
	}

	public List<EtDescriptions> getEtDescriptionsList() {
		return etDescriptionsList;
	}

	public void setEtDescriptionsList(List<EtDescriptions> etDescriptionsList) {
		this.etDescriptionsList = etDescriptionsList;
	}

	public EtDescriptions addEtDescriptions(EtDescriptions etDescriptions) {
		getEtDescriptionsList().add(etDescriptions);
		etDescriptions.setEtConcepts(this);
		return etDescriptions;
	}

	public EtDescriptions removeEtDescriptions(EtDescriptions etDescriptions) {
		getEtDescriptionsList().remove(etDescriptions);
		etDescriptions.setEtConcepts(null);
		return etDescriptions;
	}

	public EtVersions getEtVersions() {
		return etVersions;
	}

	public void setEtVersions(EtVersions etVersions) {
		this.etVersions = etVersions;
	}

	public String getInputPy() {
		return inputPy;
	}

	public void setInputPy(String inputPy) {
		this.inputPy = inputPy;
	}

	public String getInputWb() {
		return inputWb;
	}

	public void setInputWb(String inputWb) {
		this.inputWb = inputWb;
	}

	public String getInputCd() {
		return inputCd;
	}

	public void setInputCd(String inputCd) {
		this.inputCd = inputCd;
	}

	public String getInputExt1() {
		return inputExt1;
	}

	public void setInputExt1(String inputExt1) {
		this.inputExt1 = inputExt1;
	}

	public String getInputExt2() {
		return inputExt2;
	}

	public void setInputExt2(String inputExt2) {
		this.inputExt2 = inputExt2;
	}

	public String getCreatedByName() {
		return createdByName;
	}

	public void setCreatedByName(String createdByName) {
		this.createdByName = createdByName;
	}

	public String getLastUpdatedByName() {
		return lastUpdatedByName;
	}

	public void setLastUpdatedByName(String lastUpdatedByName) {
		this.lastUpdatedByName = lastUpdatedByName;
	}

	public String getConceptClass() {
		return conceptClass;
	}

	public void setConceptClass(String conceptClass) {
		this.conceptClass = conceptClass;
	}

	public String getFreqCounter() {
		return freqCounter;
	}

	public void setFreqCounter(String freqCounter) {
		this.freqCounter = freqCounter;
	}

	public String getFreqInterval() {
		return freqInterval;
	}

	public void setFreqInterval(String freqInterval) {
		this.freqInterval = freqInterval;
	}

	public String getFreqIntervalUnit() {
		return freqIntervalUnit;
	}

	public void setFreqIntervalUnit(String freqIntervalUnit) {
		this.freqIntervalUnit = freqIntervalUnit;
	}

	public String getAdministrations() {
		return administrations;
	}

	public void setAdministrations(String administrations) {
		this.administrations = administrations;
	}

	public String getDefaultSchedule() {
		return defaultSchedule;
	}

	public void setDefaultSchedule(String defaultSchedule) {
		this.defaultSchedule = defaultSchedule;
	}

	public byte[] getEtBlob() {
		return etBlob;
	}

	public void setEtBlob(byte[] etBlob) {
		this.etBlob = etBlob;
	}

	public String getEtClob() {
		return etClob;
	}

	public void setEtClob(String etClob) {
		this.etClob = etClob;
	}

    public String getWriteTypeDictCode()
    {
        return writeTypeDictCode;
    }

    public void setWriteTypeDictCode(String writeTypeDictCode)
    {
        this.writeTypeDictCode = writeTypeDictCode;
    }

    public String getMqaModelCode()
    {
        return mqaModelCode;
    }

    public void setMqaModelCode(String mqaModelCode)
    {
        this.mqaModelCode = mqaModelCode;
    }

    public String getIntactValue()
    {
        return intactValue;
    }

    public void setIntactValue(String intactValue)
    {
        this.intactValue = intactValue;
    }

    public String getIsCoexist()
    {
        return isCoexist;
    }

    public void setIsCoexist(String isContaints)
    {
        this.isCoexist = isContaints;
    }

    public String getRateHour()
    {
        return rateHour;
    }

    public void setRateHour(String rateHour)
    {
        this.rateHour = rateHour;
    }

    public String getPatientConditionCode()
    {
        return patientConditionCode;
    }

    public void setPatientConditionCode(String patientConditionCode)
    {
        this.patientConditionCode = patientConditionCode;
    }

    public String getIsEquipped()
    {
        return isEquipped;
    }

    public void setIsEquipped(String isEquipped)
    {
        this.isEquipped = isEquipped;
    }

    public String getAttentionRoleCode()
    {
        return attentionRoleCode;
    }

    public void setAttentionRoleCode(String attentionRoleCode)
    {
        this.attentionRoleCode = attentionRoleCode;
    }

    public String getAttentionMessages()
    {
        return attentionMessages;
    }

    public void setAttentionMessages(String attentionMessages)
    {
        this.attentionMessages = attentionMessages;
    }

    public String getMrDocumentClassCode()
    {
        return mrDocumentClassCode;
    }

    public void setMrDocumentClassCode(String mrDocumentClassCode)
    {
        this.mrDocumentClassCode = mrDocumentClassCode;
    }

    public String getGradeScaleStdCode()
    {
        return gradeScaleStdCode;
    }

    public void setGradeScaleStdCode(String gradeScaleStdCode)
    {
        this.gradeScaleStdCode = gradeScaleStdCode;
    }

    public String getIsAddUp()
    {
        return isAddUp;
    }

    public void setIsAddUp(String isAddUp)
    {
        this.isAddUp = isAddUp;
    }

    public String getIsAutoCount()
    {
        return isAutoCount;
    }

    public void setIsAutoCount(String isAutoCount)
    {
        this.isAutoCount = isAutoCount;
    }
}
